﻿function ClientAddLawDocumentSigner()
{
    Url=Portal.CMS.LawDocumentSigner.GetAddGroupNewUrl().value;
    window.open(Url, '_blank');
    //RealJumpPageLawDocumentSigner();
}

function ClientSaveAddLawDocumentSigner()
{
    Subject=document.getElementById("txtSubject").value;
    RetValue = Portal.CMS.AddLawDocumentSigner.ServerSideAddLawDocumentSigner(Subject).value;
    if(RetValue.indexOf("ERROR")!=-1)
    {
        alert(RetValue);
        return;
    }
    alert(RetValue);
    document.getElementById("txtSubject").value="";
    document.getElementById("txtSubject").focus();
}

function ClientDeleteLawDocumentSigner(LawDocumentSignerId)
{
    Msg=Portal.CMS.LawDocumentSigner.ServerSideCheckDeleteLawDocumentSigner().value;
    if(Msg.indexOf("ERROR")!=-1)
    {
        alert(Msg);
        return;
    }
    
    Msg=Portal.CMS.LawDocumentSigner.GetConfirmDeleteMsg().value;
    if(confirm(Msg)==false)return;
    RetValue = Portal.CMS.LawDocumentSigner.ServerSideDeleteLawDocumentSigner(LawDocumentSignerId).value;
    if(RetValue.indexOf("ERROR")!=-1)
    {
        alert(RetValue);
        return;
    }
    alert(RetValue);
    RealJumpPageLawDocumentSigner();
}

function ShowClientUpdateUrlForm(LawDocumentSignerId)
{
    Url=Portal.CMS.LawDocumentSigner.GetShowUpdateForm(LawDocumentSignerId).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    window.open(Url, '_blank');
//    RealJumpPageLawDocumentSigner();
}



function ClientSaveUpdateLawDocumentSigner(LawDocumentSignerId)
{
    Subject=document.getElementById("txtSubject").value;
    RetValue = Portal.CMS.UpdateLawDocumentSigner.ServerSideUpdateLawDocumentSigner(LawDocumentSignerId,Subject).value;
    if(RetValue.indexOf("ERROR")!=-1)
    {
        alert(RetValue);
        return;
    }
    alert(RetValue);
    window.close();
}


function ShowClientLawDocumentSignerItemUrlForm(LawDocumentSignerId)
{
    Url=Portal.CMS.LawDocumentSigner.GetShowLawDocumentSignerItemsForm(LawDocumentSignerId).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    window.open(Url, '_blank');
}

function ClientShowNewsItemForms(LawDocumentSignerId)
{
    Url=Portal.CMS.LawDocumentSigner.GetShowNewsItemForm(LawDocumentSignerId).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    window.open(Url, '_blank');
}



function JumPageLawDocumentSigner()
{
    document.getElementById("divProcessing").innerHTML=Portal.CMS.LawDocumentSigner.GetProcessingText().value;
    setTimeout("RealJumpPageLawDocumentSigner()",10);
}

function RealJumpPageLawDocumentSigner()
{
    PageIndex=0;
    if(document.getElementById("divSelectPageLawDocumentSigner")!=null)
    {   
        PageIndex=document.getElementById("divSelectPageLawDocumentSigner").selectedIndex;
    }
    Keyword=document.getElementById("txtKeyword").value;
    retValue=Portal.CMS.LawDocumentSigner.GetHtml(Keyword,PageIndex).value;
    if(retValue.indexOf("ERROR")!=-1)
    {
        alert(retValue);
        return;
    }
    document.getElementById("divProcessing").innerHTML="";
    document.getElementById("divLawDocumentSignerMain").innerHTML=retValue;
}